package com.example.backend.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.backend.entity.BookletVO;
import com.example.backend.entity.UserBooklet;
import com.example.backend.entity.UserPost;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author Jcy
 * @Date 2022/5/4
 */
@Mapper
public interface UserPostMapper extends BaseMapper<UserPost> {
    @Delete("DELETE from tb_user_post WHERE tb_user_post.post_id =#{postId}")
    void deletefromUserPost(@Param("postId") int postId);
    @Select("SELECT tb_user_post.post_id FROM tb_user_post WHERE tb_user_post.user_id=#{userId}")
    int getPostId(int userId);
    @Select("SELECT * FROM tb_user_post WHERE tb_user_post.user_id=#{userId}")
    UserBooklet isPost(int userId);
}
